


HOSTNAME=$1
#echo  ${HOSTNAME#*-}.${HOSTNAME%%-*}
hostip=`ping -c 1   ${HOSTNAME#*-}.${HOSTNAME%%-*}   2>/dev/null |awk '/ttl/ {print $4}'` 
# 解析域名

if [ ! ${#hostip} -ge 7 ];then
echo '主机名无法解析'
exit 1
fi

echo $hostip
